package com.slz3.business.module.systemManagement.sysRole.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.systemManagement.sysRole.domain.SysRole;
import com.slz3.business.module.systemManagement.sysRole.domain.SysRoleCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SysRoleResController {

    static Mono<ServerResponse> add(ServerRequest req, SysRole sysRole) {
        if (SysRoleResUnsafeValid.add(req, sysRole)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysRoleResAtomic.add_$SysRoleUpdateLock(req, sysRole);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, SysRoleCondition sysRoleCondition) {
        if (SysRoleResUnsafeValid.delete(req, sysRoleCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysRoleResAtomic.delete_$SysRoleUpdateLock(req, sysRoleCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, SysRole sysRole) {
        if (SysRoleResUnsafeValid.modify(req, sysRole)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysRoleResAtomic.modify_$SysRoleUpdateLock(req, sysRole);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (SysRoleResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysRoleResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (SysRoleResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysRoleResAtomic.info_$SysRoleUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (SysRoleResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysRoleResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, SysRoleCondition sysRoleCondition) {
        //
        if (SysRoleResUnsafeValid.auditSubmit(req, sysRoleCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysRoleResAtomic.auditSubmit_$SysRoleUpdateLock(req, sysRoleCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, SysRoleCondition sysRoleCondition) {
        if (SysRoleResUnsafeValid.audit(req, sysRoleCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysRoleResAtomic.audit_$SysRoleUpdateLock(req, sysRoleCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, SysRoleCondition sysRoleCondition) {
        if (SysRoleResUnsafeValid.auditReject(req, sysRoleCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysRoleResAtomic.auditReject_$SysRoleUpdateLock(req, sysRoleCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, SysRoleCondition sysRoleCondition) {
        if (SysRoleResUnsafeValid.usingEnable(req, sysRoleCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysRoleResAtomic.usingEnable_$SysRoleUpdateLock(req, sysRoleCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, SysRoleCondition sysRoleCondition) {
        if (SysRoleResUnsafeValid.usingDisable(req, sysRoleCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysRoleResAtomic.usingDisable_$SysRoleUpdateLock(req, sysRoleCondition);
        }
    }

}
